<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableLuckDrawLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('luck_draw_log', function (Blueprint $table) {
            $table->id();
            $table->integer('luck_id')->unsigned()->default(0)->comment('抽奖券ID');
            $table->integer('draw_id')->unsigned()->default(0)->comment('奖品ID');
            $table->integer('user_id')->unsigned()->default(0)->comment('用户ID');
            $table->tinyInteger('is_delete')->unsigned()->default(0)->comment('1是 0否');
            $table->string('luck_name',50)->default('')->comment('抽奖券名');
            $table->string('draw_name',50)->default('')->comment('奖品名');
            $table->string('user_name',50)->default('')->comment('用户名');
            $table->timestamp('draw_time')->comment('抽奖时间');
            $table->timestamps();
        });
        DB::statement('alter table ex_luck_draw_log comment "抽奖记录表"');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('luck_draw_log');
    }
}
